<%@page import="models.Inlink"%>
<%@page import="controller.Utils"%>
<%@page import="java.text.NumberFormat"%>
<%@page import="models.Domain"%>
<%@page import="com.googlecode.objectify.Query"%>
<%
Domain list = (Domain) request.getAttribute("list");
Inlink inlink = (Inlink) request.getAttribute("inlink");
String domain = (String) request.getAttribute("domain");
NumberFormat nf = NumberFormat.getInstance();
String url = "out-link/"+domain;

String title = "Check link "+domain;
String description="In-link and out-link of "+domain+" on showsiteinfo";
String keyword = domain+","+"link,outlink,check link";
%>

<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keyword %>"/>
</jsp:include>
        
	<div class="bd">
		<div class="l">
			<div class="rib">
				<h2>Check Link</h2>
			</div>
			<div class="cont">
				<p></p>
				<div class="network">
                 	<form method="get" action="/search-link">
						<div class="search">
							<input type="text" onclick="javascript:if(this.value=='Enter your domain')this.value=''" name="name" value="Enter your domain">
							<button>Check Link</button>
						</div>
					</form>
                </div>
                
                <h2 class="ti"><a href="/sites/<%=domain %>" class="font"><%=domain %></a></h2>
                <%
                	int count = 0;
                    if(list!=null&&list.getOutLink()!=null&&!list.getOutLink().getValue().equals(""))
     		 		{
     		 			String[] arrs = list.getOutLink().getValue().split(",");
     		 			count = arrs.length;
     		 		}
                %>
                <p>Out-link is a link that points from your website to another website. These are out-links list of <i><%=domain %></i> ( <strong><%=count %></strong> ) <a href="/out-link/<%=domain %>" rel="nofollow">View all</a></p>
                
                <div id="featuredservice">
	        		 <table class="exp">
	        		 	<%
						int end = 0;
	        		 		if(list!=null&&list.getOutLink()!=null&&!list.getOutLink().getValue().equals(""))
	        		 		{
	        		 	%>
	        		 	<tr>
	        		 		<th>Domain</th>
	        		 		<th></th>
	        		 	</tr>
	        		 	<%
	        		 			String[] arr = list.getOutLink().getValue().split(",");
	        		 			if(arr.length < 10)
								{
									end = arr.length;
								} else {
									end = 10;
								}
	        		 			for(int i=0;i < end;i++)
								{
	        		 	%>
	        		 		<tr>
		        		 		<td><% if(!Utils.fomatDomain(arr[i]).trim().equals("")){ %><a href="/sites/<%=Utils.fomatDomain(arr[i]) %>"><%=Utils.fomatDomain(arr[i]) %></a><% } %></td>
		        		 		<td class="right"><% if(!Utils.fomatDomain(arr[i]).trim().equals("")){ %><a href="/check-link/<%=Utils.fomatDomain(arr[i]) %>" rel="nofollow">Check link</a><% } %></td>
		        		 	</tr>
	        		 	<%
								}
	        		 		} else {
	        		 	%>
	        		 		
	        		 	<%
	        		 		}
	        		 	%>
	        		 </table>    
                      </div>     
        		 <div class="clear"></div>
        		 <div id="welcomecontent">
                      	<%
                      	count = 0;
                      	if(inlink!=null&&inlink.getInLink()!=null)
       		 		{
                      		count = inlink.getInLink().size();
       		 		}
                      	%>
                      	<p>In-Links : Another name for backlinks, or links into a domain from external sources.These are in-links list of <i><%=domain %></i> ( <strong><%=count %></strong> ) <a href="/in-link/<%=domain %>" rel="nofollow">View all</a></p>
                      </div>
                      <div id="featuredservice">
	        		 <table class="exp">
	        		 	<%
						int k=0;
	        		 		if(inlink!=null&&inlink.getInLink()!=null)
	        		 		{
	        		 	%>
	        		 	<tr>
	        		 		<th>Domain</th>
	        		 		<th></th>
	        		 	</tr>
	        		 	<%
	        		 			if(inlink.getInLink().size()<10)
								{
									end = inlink.getInLink().size();
								} else {
									end = 10;
								}
	        		 			for(int i=0;i < end;i++)
								{
	        		 				k++;
	        		 	%>
	        		 		<tr>
		        		 		<td><a href="/sites/<%=Utils.fomatDomain(inlink.getInLink().get(i)) %>"><%=Utils.fomatDomain(inlink.getInLink().get(i)) %></a></td>
		        		 		<td class="right"><a href="/check-link/<%=Utils.fomatDomain(inlink.getInLink().get(i)) %>" rel="nofollow">Check link</a></td>
		        		 	</tr>
	        		 	<%
								}
	        		 		} else {
	        		 			if(list==null||(list!=null&&list.getOutLink()!=null&&list.getOutLink().getValue().equals("")))
		        		 		{
	        		 	%>
	        		 		<tr><td>
	        		 			Currently, we don't find in-links or out-link from your site. You can use tools is listed below to find more and more information about your site.
	        		 			<br/><br/>
	        		 			<a href="/network-tool">Network tool</a> | <a href="/pagerank">Check pagerank</a> | <a href="/lookup-ip">Lookup ip</a>
	        		 		</td></tr>
	        		 	<%
		        		 		}
	        		 		}
	        		 	%>
	        		 </table>    
                      </div>
			</div>
		</div>
		<div class="r">
			<%@ include file='/element/search.jsp'%>
			
			<div class="bol">
				<jsp:include page="adv/adv2.jsp"></jsp:include> 
			</div>
			<div class="bol">
				<jsp:include page="adv/adv2.jsp"></jsp:include> 
			</div>
		</div>
	</div>         	

 <jsp:include page="layout/footer.jsp"></jsp:include>           